package org.kth.dks.test_bed;

/**
 * <p>Title: DKS</p>
 * <p>Description: DKS Middleware</p>
 * <p>Copyright: Copyright (c) 2005</p>
 * <p>Company: KTH-IMIT/SICS</p>
 * @author Ali Ghodsi (aligh@kth.se)
 * @version 1.0
 */

import java.io.BufferedReader;
import java.io.InputStreamReader;

import org.kth.dks.JDHT;

public class JDHTServer {
	public static void main(String[] arg) {
		try {

			// Could declare myDHT as a java.util.Map
			JDHT myDHT = new JDHT();

			// Insert data into the DHT
			myDHT.put("myKey", "Hello World!");

			// Print a reference to this node
			System.out.println( ((JDHT)myDHT).getReference() );

			// Wait for input before exiting
			BufferedReader cin = new BufferedReader( new InputStreamReader(System.in) );
			cin.read();

			// shut down
			myDHT.close();

		} catch(Exception ex) { ex.printStackTrace(); }
	}
}
